<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.5"/>
<title>axiethernet: xaxiethernet_example_extmulticast.c File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="HTML_custom.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="xlogo_bg.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">axiethernet
   </div>
   <div id="projectbrief">Vitis Drivers API Documentation</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.5 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Overview</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li><a href="globals.html"><span>APIs</span></a></li>
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="pages.html"><span>Examples</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('xaxiethernet__example__extmulticast_8c.html','');});
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">xaxiethernet_example_extmulticast.c File Reference</div>  </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">Overview</h2>
<div class="textblock"><p>Implements examples that utilize the AXI Ethernet's interrupt driven DMA packet transfer mode to send and receive multicast frames when XAE_EXT_MULTICAST_OPTION is enabled. </p>
<p>This example demonstrates:</p>
<ul>
<li>How to perform option enable</li>
<li>Which interrupt BD word are verified and confirm it is a valid multicast frame.</li>
</ul>
<p>Functional guide to example:</p>
<ul>
<li>AxiEthernetSgDmaIntrExtMulticast Example demonstrates the extended multicast. The HW must be setup for extended multicast for this example to execute.</li>
</ul>
<pre>
MODIFICATION HISTORY:</pre><pre>Ver   Who  Date     Changes
</p>
<hr/>
<p>
1.00a asa  4/30/10  First release based on the ll temac driver
1.01a asa  12/10/10 Changes made to enable the AXIDMA Tx/Rx ring interrupts
                          before allocation of Tx/Rx BDs.
3.00a asa  6/25/12  Modified XAxiDma_BdSetLength API call to support new
                          AXI DMA driver version 7.00a.
3.00a bss  10/22/12 Added support for Fast Interrupt Handlers.
3.01a srt  02/14/13 Added support for Zynq (CR 681136)
5.4   ms   01/23/17 Modified xil_printf statement in main function to
                    ensure that "Successfully ran" and "Failed" strings are
                    available in all examples. This is a fix for CR-965028.
      ms   04/05/17 Added tabspace for return statements in functions
                    for proper documentation while generating doxygen.
5.7   rsp  19/12/17 Defined Padding and ExternalLoopback variables.
</pre> </div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a28370d674b4e17c6f8ccbb3fa7020cee"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xaxiethernet__example__extmulticast_8c.html#a28370d674b4e17c6f8ccbb3fa7020cee">AxiEthernetMcastExample</a> (INTC *IntcInstancePtr, <a class="el" href="struct_x_axi_ethernet.html">XAxiEthernet</a> *AxiEthernetInstancePtr, XAxiDma *DmaInstancePtr, u16 AxiEthernetDeviceId, u16 AxiDmaDeviceId, u16 AxiEthernetIntrId, u16 DmaRxIntrId, u16 DmaTxIntrId)</td></tr>
<tr class="memdesc:a28370d674b4e17c6f8ccbb3fa7020cee"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function demonstrates the usage usage of the Axi Ethernet extended multicast feature.  <a href="#a28370d674b4e17c6f8ccbb3fa7020cee">More...</a><br/></td></tr>
<tr class="separator:a28370d674b4e17c6f8ccbb3fa7020cee"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aeee0fd063830698a2fd65ff131e737a2"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xaxiethernet__example__extmulticast_8c.html#aeee0fd063830698a2fd65ff131e737a2">AxiEthernetSgDmaIntrExtMulticastExample</a> (<a class="el" href="struct_x_axi_ethernet.html">XAxiEthernet</a> *AxiEthernetInstancePtr, XAxiDma *DmaInstancePtr)</td></tr>
<tr class="memdesc:aeee0fd063830698a2fd65ff131e737a2"><td class="mdescLeft">&#160;</td><td class="mdescRight">This example sends and receives a single packet in loopback mode with extended multicast address support.  <a href="#aeee0fd063830698a2fd65ff131e737a2">More...</a><br/></td></tr>
<tr class="separator:aeee0fd063830698a2fd65ff131e737a2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a840291bc02cba5474a4cb46a9b9566fe"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xaxiethernet__example__extmulticast_8c.html#a840291bc02cba5474a4cb46a9b9566fe">main</a> (void)</td></tr>
<tr class="memdesc:a840291bc02cba5474a4cb46a9b9566fe"><td class="mdescLeft">&#160;</td><td class="mdescRight">This is the main function for the Axi Ethernet example.  <a href="#a840291bc02cba5474a4cb46a9b9566fe">More...</a><br/></td></tr>
<tr class="separator:a840291bc02cba5474a4cb46a9b9566fe"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="a28370d674b4e17c6f8ccbb3fa7020cee"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int AxiEthernetMcastExample </td>
          <td>(</td>
          <td class="paramtype">INTC *&#160;</td>
          <td class="paramname"><em>IntcInstancePtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="struct_x_axi_ethernet.html">XAxiEthernet</a> *&#160;</td>
          <td class="paramname"><em>AxiEthernetInstancePtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">XAxiDma *&#160;</td>
          <td class="paramname"><em>DmaInstancePtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u16&#160;</td>
          <td class="paramname"><em>AxiEthernetDeviceId</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u16&#160;</td>
          <td class="paramname"><em>AxiDmaDeviceId</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u16&#160;</td>
          <td class="paramname"><em>AxiEthernetIntrId</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u16&#160;</td>
          <td class="paramname"><em>DmaRxIntrId</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u16&#160;</td>
          <td class="paramname"><em>DmaTxIntrId</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function demonstrates the usage usage of the Axi Ethernet extended multicast feature. </p>
<p>It uses AXI DMA core in interrupt mode to transfer Ethernet frames.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">IntcInstancePtr</td><td>is a pointer to the instance of the Intc component. </td></tr>
    <tr><td class="paramname">AxiEthernetInstancePtr</td><td>is a pointer to the instance of the AxiEthernet component. </td></tr>
    <tr><td class="paramname">DmaInstancePtr</td><td>is a pointer to the instance of the AXIDMA component. </td></tr>
    <tr><td class="paramname">AxiEthernetDeviceId</td><td>is Device ID of the Axi Ethernet Device , typically XPAR_&lt;AXIETHERNET_instance&gt;_DEVICE_ID value from xparameters.h. </td></tr>
    <tr><td class="paramname">AxiDmaDeviceId</td><td>is Device ID of the Axi DMAA Device , typically XPAR_&lt;AXIDMA_instance&gt;_DEVICE_ID value from xparameters.h. </td></tr>
    <tr><td class="paramname">AxiEthernetIntrId</td><td>is the Interrupt ID and is typically XPAR_&lt;INTC_instance&gt;_&lt;AXIETHERNET_instance&gt;_VEC_ID value from xparameters.h. </td></tr>
    <tr><td class="paramname">DmaRxIntrId</td><td>is the interrupt id for DMA Rx and is typically taken from XPAR_&lt;AXIETHERNET_instance&gt;_CONNECTED_DMARX_INTR </td></tr>
    <tr><td class="paramname">DmaTxIntrId</td><td>is the interrupt id for DMA Tx and is typically taken from XPAR_&lt;AXIETHERNET_instance&gt;_CONNECTED_DMATX_INTR</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><ul>
<li>XST_SUCCESS to indicate success.</li>
<li>XST_FAILURE.to indicate failure.</li>
</ul>
</dd></dl>
<dl class="section note"><dt>Note</dt><dd>AxiDma hardware must be initialized before initializing AxiEthernet. Since AxiDma reset line is connected to the AxiEthernet reset line, a reset of AxiDma hardware during its initialization would reset AxiEthernet. </dd></dl>

<p>References <a class="el" href="struct_x_axi_ethernet___config.html#a34b00c1ae0534cb0e956feb2a834e820">XAxiEthernet_Config::AxiDevBaseAddress</a>, <a class="el" href="struct_x_axi_ethernet___config.html#a58df9c31ad87109bd294fb26a8af9630">XAxiEthernet_Config::AxiDevType</a>, <a class="el" href="xaxiethernet__example__extmulticast_8c.html#aeee0fd063830698a2fd65ff131e737a2">AxiEthernetSgDmaIntrExtMulticastExample()</a>, <a class="el" href="xaxiethernet__example_8h.html#ac864e2449120d62d81370b033fc89c42">AxiEthernetUtilEnterLoopback()</a>, <a class="el" href="xaxiethernet__example_8h.html#ad700d3b9e292277d5437ecc4dc304dc3">AxiEthernetUtilErrorTrap()</a>, <a class="el" href="xaxiethernet__example_8h.html#a0ab0dcd0f95007ddcc441c7cbc5f45dc">AxiEthernetUtilPhyDelay()</a>, <a class="el" href="struct_x_axi_ethernet___config.html#ae3fc04787ba28bb14e6c2add45c0c086">XAxiEthernet_Config::BaseAddress</a>, <a class="el" href="struct_x_axi_ethernet.html#adda2f024038f99905bb2ca8ab85854eb">XAxiEthernet::Config</a>, <a class="el" href="group__axiethernet.html#gabe257efe600df43d8148c772ea3878f9">XAxiEthernet_CfgInitialize()</a>, <a class="el" href="group__axiethernet.html#gadc2cf9ec186f1dffaece1552f96fcdd9">XAxiEthernet_GetPhysicalInterface</a>, <a class="el" href="group__axiethernet.html#ga751c51d9ed918ca9dd556d98187eb76e">XAxiEthernet_IsExtMcast</a>, <a class="el" href="group__axiethernet.html#ga781a4d89a7a3a9d59ac8921ba66b353d">XAxiEthernet_LookupConfig()</a>, <a class="el" href="group__axiethernet.html#gab2298b2b1af89cf0f0a78d4fda03ed7f">XAxiEthernet_SetMacAddress()</a>, <a class="el" href="group__axiethernet.html#gab2d0106f26a1a2e1f2b902dc0a2822c9">XAxiEthernet_SetOperatingSpeed()</a>, and <a class="el" href="group__axiethernet.html#ga4e952a55f342f176ba9ec2b49e2e47cb">XAxiEthernet_Stop()</a>.</p>

<p>Referenced by <a class="el" href="xaxiethernet__example__extmulticast_8c.html#a840291bc02cba5474a4cb46a9b9566fe">main()</a>.</p>

</div>
</div>
<a class="anchor" id="aeee0fd063830698a2fd65ff131e737a2"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int AxiEthernetSgDmaIntrExtMulticastExample </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_x_axi_ethernet.html">XAxiEthernet</a> *&#160;</td>
          <td class="paramname"><em>AxiEthernetInstancePtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">XAxiDma *&#160;</td>
          <td class="paramname"><em>DmaInstancePtr</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This example sends and receives a single packet in loopback mode with extended multicast address support. </p>
<p>The transmit frame will be addressed one of programed multicast addresses.</p>
<p>On receive, HW should pass the frame to receive interrupt handler for further address checking.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">AxiEthernetInstancePtr</td><td>is a pointer to the instance of the AxiEthernet component. </td></tr>
    <tr><td class="paramname">DmaInstancePtr</td><td>is a pointer to the instance of the AXI DMA component.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><ul>
<li>XST_SUCCESS to indicate success.</li>
<li>XST_FAILURE to indicate failure.</li>
</ul>
</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

<p>References <a class="el" href="xaxiethernet__example_8h.html#ad700d3b9e292277d5437ecc4dc304dc3">AxiEthernetUtilErrorTrap()</a>, <a class="el" href="xaxiethernet__example_8h.html#a1eb6d3a3d578519d065f1e674d00f144">AxiEthernetUtilFrameHdrFormatMAC()</a>, <a class="el" href="xaxiethernet__example_8h.html#aa8c4f8ca2870764a5708ae0458d2b96a">AxiEthernetUtilFrameHdrFormatType()</a>, <a class="el" href="xaxiethernet__example_8h.html#a69500ccf415291fc54dfc53333f98a07">AxiEthernetUtilFrameMemClear()</a>, <a class="el" href="xaxiethernet__example_8h.html#a5b2b391e4495ed818546c7ec695a724a">AxiEthernetUtilFrameSetPayloadData()</a>, <a class="el" href="xaxiethernet__example_8h.html#a561ef796435e1aa0b0eb5013bfb54cea">AxiEthernetUtilFrameVerify()</a>, <a class="el" href="struct_x_axi_ethernet.html#a5d0462ce1e0c0e7a5ee977413a94ca17">XAxiEthernet::Options</a>, <a class="el" href="group__axiethernet.html#ga71e31b002d0e8c019bad31fc22b21c8e">XAE_DEFAULT_OPTIONS</a>, <a class="el" href="group__axiethernet.html#ga200a4ee26fb655cce6de8edc7a3cc6b9">XAE_EXT_MULTICAST_OPTION</a>, <a class="el" href="group__axiethernet.html#ga28f85be33530a1bf741db5f9738e3a14">XAE_INT_RECV_ERROR_MASK</a>, <a class="el" href="group__axiethernet.html#ga027d60f8fd28b519cad51e450b71c07b">XAE_RECEIVER_ENABLE_OPTION</a>, <a class="el" href="group__axiethernet.html#ga1e81b6f5f677ed0370507c117b565b20">XAE_TRANSMITTER_ENABLE_OPTION</a>, <a class="el" href="group__axiethernet.html#gac6e848552b34aa85f6801ab269521cf3">XAxiEthernet_AddExtMulticastGroup()</a>, <a class="el" href="group__axiethernet.html#gad3e7253d626c02a96ac35f981ac11ba2">XAxiEthernet_ClearOptions()</a>, <a class="el" href="group__axiethernet.html#ga6932bd79a08811085a47ad1357a4ef89">XAxiEthernet_GetExtMulticastGroup()</a>, <a class="el" href="group__axiethernet.html#gab5476b0e04b0ecd8f9fd027f90ea648f">XAxiEthernet_IntEnable</a>, <a class="el" href="group__axiethernet.html#ga751c51d9ed918ca9dd556d98187eb76e">XAxiEthernet_IsExtMcast</a>, <a class="el" href="group__axiethernet.html#gab2298b2b1af89cf0f0a78d4fda03ed7f">XAxiEthernet_SetMacAddress()</a>, <a class="el" href="group__axiethernet.html#gae3265620b9d9b86643abe5ff5e2b7d79">XAxiEthernet_SetOptions()</a>, and <a class="el" href="group__axiethernet.html#ga2cfa48d42e55238f6f30aff6d658e4fe">XAxiEthernet_Start()</a>.</p>

<p>Referenced by <a class="el" href="xaxiethernet__example__extmulticast_8c.html#a28370d674b4e17c6f8ccbb3fa7020cee">AxiEthernetMcastExample()</a>.</p>

</div>
</div>
<a class="anchor" id="a840291bc02cba5474a4cb46a9b9566fe"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int main </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This is the main function for the Axi Ethernet example. </p>
<p>This function is not included if the example is generated from the TestAppGen test tool.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">None.</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><ul>
<li>XST_SUCCESS to indicate success.</li>
<li>XST_FAILURE to indicate failure</li>
</ul>
</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

<p>References <a class="el" href="xavb__example_8c.html#a249ec82daff032bfe981d21980bae55c">AXIETHERNET_DEVICE_ID</a>, <a class="el" href="xaxiethernet__example__extmulticast_8c.html#a28370d674b4e17c6f8ccbb3fa7020cee">AxiEthernetMcastExample()</a>, and <a class="el" href="xaxiethernet__example_8h.html#ad700d3b9e292277d5437ecc4dc304dc3">AxiEthernetUtilErrorTrap()</a>.</p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
	<p class="footer">&copy; Copyright 2015-2022 Xilinx, Inc. All Rights Reserved.</p>
	<p class="footer">&copy; Copyright 2022-2023 Advanced Micro Devices, Inc. All Rights Reserved.</p>
</div>
</body>
</html>
